uts: add ProxyManager and ProxySession for integration tests#1210
Draft
ttypic wants to merge 12 commits into
Draft
uts: add ProxyManager and ProxySession for integration tests#1210ttypic wants to merge 12 commits into
ProxyManager and ProxySession for integration tests#1210ttypic wants to merge 12 commits into
Conversation
- Added `MockHttpClient`, `MockHttpEngine`, and `MockWebSocketEngineFactory` to simulate network interactions. - Extended `DebugOptions` for customizable engine injection. - Updated `HttpCore` and `WebSocketTransport` to support mock engines in debug mode.
…ge handling - Added `MockWebSocket` and `MockEvent` to capture WebSocket connection attempts, messages, and error scenarios. - Added connection lifecycle events (`ConnectionEstablished`, `ConnectionRefused`, etc.) for enhanced testing. - Updated `MockWebSocketEngineFactory` and related components to support event tracking and simulation.
- Added `Clock` interface and concrete implementations (`SystemClock` and `FakeClock`) for unified time management. - Refactored classes (`Auth`, `Presence`, `Hosts`, `WebSocketTransport`, etc.) to use `Clock` instead of direct system calls. - Enabled mockable time-based operations for improved testability. - Updated `DebugOptions` to support custom clocks in debug mode.
…in tests - Introduced a new skill for converting UTS pseudocode specs into runnable Kotlin tests. - Included detailed translation rules for pseudocode to Kotlin, mock setup, and assertions. - Added file templates and steps for compilation, testing, and handling deviations. - Enhanced developer workflow for UTS test authoring.
…ssage decoding - Added support for inspecting outgoing WebSocket frames (`MessageFromClient` events) in `MockWebSocket`. - Enhanced `ClientOptionsBuilder` to set `useBinaryProtocol = false` by default for JSON text frame testing. - Updated `ConnectionRecoveryTest` to assert on outgoing ATTACH messages.
…onnections - Added `queryParams` field and `parseQueryString` utility for `PendingConnection` implementations. - Updated `MockWebSocketEngineFactory` and `MockHttpEngine` to parse and pass query parameters. - Enhanced connection recovery tests with assertions on query parameters.
- Added KDoc comments to `FakeClock`, `MockHttpClient`, and `MockWebSocket` explaining their purpose and usage.
… lifecycle management - Introduced `ProxyManager` to manage the `uts-proxy` binary lifecycle, including downloading, verification, and process control. - Added `ProxySession` for managing proxy sessions with rules, actions, event logging, and cleanup. - Included KDoc documentation for clear usage guidelines in integration tests.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ProxyManager and ProxySession for integration test proxy…ProxyManager and ProxySession for integration tests
ce07a09 to
9322674
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ProxyManagerto manage theuts-proxybinary lifecycle, including downloading, verification, and process control.ProxySessionfor managing proxy sessions with rules, actions, event logging, and cleanup.